// 业务总览相关接口

import services from '../createServices';

// 业务总览
export const dashboard = {
  filter: (params) => services.post('/overview/index', { params, isLoading: true }),
  riskTrend: (params) => services.post('/overview/risk-trend', { params, isLoading: true }),
  strategyTrend: (params) => services.post('/overview/strategy-trend', { params, isLoading: true }),
  ruleTrend: (params) => services.post('/overview/rule-trend', { params, isLoading: true }),
  ruleTop: (params) => services.post('/overview/rule-top', { params, isLoading: true }),
  riskTop: (params) => services.post('/overview/requests', { params, isLoading: true }),
  ruleList: (params) => services.post('/rule/all', { params, isLoading: true }),
  strategyType: (params) => services.post('/overview/strategy-type-list', { params }),
  strategyList: (params) => services.post('/overview/strategy-all', { params, isLoading: true }),
};

// 新业务总览
export const dashboardApi = {
  filter: (params) => services.post('/business-overview/index', { params, isLoading: true }), // 业务总览请求总览
  requestTrend: (params) => services.post('/business-overview/request-trend', { params, isLoading: true }), // 请求趋势统计
  requestDistributed: (params) => services.post('/business-overview/request-distributed', { params, isLoading: true }), // 请求分布分析
  hitTrend: (params) => services.post('/business-overview/hit-trend', { params, isLoading: true }), // 命中趋势分析
  caseAnalysis: (params) => services.post('/business-overview/case-analysis', { params, isLoading: true }), // 案件数据分析
  riskRanking: (params) => services.post('/business-overview/risk-ranking', { params, isLoading: true }), // 风险命中排行
  strategyAnalysis: (params) => services.post('/business-overview/strategy-trend-analysis', { params, isLoading: true }), // 策略，组件命中趋势
  ruleTrend: (params) => services.post('/business-overview/rule-trend-analysis', { params, isLoading: true}), // 规则命中
  allVersions: (params) => services.post('/strategy-production/all-version', { params }), // 策略的发布版本
  strategyReleaseAll: (params) => services.post('/strategy-production/all', { params, isLoading: true }),
  all: (params) => services.post('/strategy-component/all', { params, isLoading: true }),
  ruleList: (params) => services.post('/rule/all', { params, isLoading: true }),
}

// 大盘
export const riskDashboard = {
  eventRatio: (params) => services.post('/dashboard/event-ratio', { params, isLoading: true }),
  request: (params) => services.post('/dashboard/request', { params, isLoading: true }),
  ruleTrend: (params) => services.post('/dashboard/risk-trend', { params, isLoading: true }),
  riskStatistics: (params) => services.post('/dashboard/risk-statistics', { params, isLoading: true }),
  requestSource: (params) => services.post('/dashboard/request-source', { params, isLoading: true }),
  ruleList: (params) => services.post('/rule/all', { params, isLoading: true }),
  requestList: (params) => services.post('/dashboard/request-list', { params }),
  cityTop: (params) => services.post('/dashboard/request-source-city-top', { params, isLoading: true }),
  setting: (params) => services.post('/dashboard/setting', { params, isLoading: true }),
  getSetting: (params) => services.get('/dashboard/setting', { params, isLoading: true }),
};
